<!--  -->
<template>
  <div>首页
    <div>
     <RouterLink to="/login">登录</RouterLink>

     <button @click="toLogin">登录</button>

     
     <button @click="toAbout">关于我们</button>
     <button @click="toNews">新闻</button>
     </div>
  </div>
</template>

<script  setup>
import { RouterLink,useRouter} from 'vue-router';
 const router=useRouter();

const toLogin=()=>{

   router.push("/login");

 // router.push({path:"/login",query:{id:1000,cat:"user"}});

}
const toAbout=()=>{

  router.push({path:"/about",query:{id:100000}})
}

const toNews=()=>{

    router.push({name:"News",params:{cat:20000}})
  
  //router.push("/news/30000")
}
 
</script>
<style scoped>
</style>